GPX: Don't emit name and descr if we don't have them.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 1 Nov 2002 02:45:10 +0000 (02:45 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 1 Nov 2002 02:45:10 +0000 (02:45 +0000)
magproto: remove debug msg
gpsread: alleged fix for banana.

gpsbabel/gpx.c
gpsbabel/jeeps/gpsread.c
gpsbabel/magproto.c

index dacf8cebb178df0b65be16fe38341dda848897bf..5f332fe9952c6d7e0104cac20026da708872395d 100644 (file)
@@ -299,16 +299,21 @@ gpx_write_time(const time_t timep)
 static void
 gpx_waypt_pr(const waypoint *waypointp)
 {
+       const char *oname = global_opts.synthesize_shortnames ?
+                                 mkshort(waypointp->description) : 
+                                 waypointp->shortname;
 
        fprintf(ofd, "<wpt lat=\"%lf\" lon=\"%lf\">\n",
                waypointp->position.latitude.degrees,
                waypointp->position.longitude.degrees);
-       fprintf(ofd, "<name>%s</name>\n", global_opts.synthesize_shortnames ?
-                                         mkshort(waypointp->description) : 
-                                         waypointp->shortname);
-       fprintf(ofd, "<desc>");
-       fprintf(ofd, "<![CDATA[%s]]>", waypointp->description);
-       fprintf(ofd, "</desc>\n");
+       if (oname) {
+               fprintf(ofd, "<name>%s</name>\n", oname);
+       }
+       if (waypointp->description) {
+               fprintf(ofd, "<desc>");
+               fprintf(ofd, "<![CDATA[%s]]>", waypointp->description);
+               fprintf(ofd, "</desc>\n");
+       }
        if (waypointp->position.altitude.altitude_meters) {
                fprintf(ofd, "<ele>\n%f\n</ele>\n",
                         waypointp->position.altitude.altitude_meters);
index a645d89753e102a760a796b43caedc7dc873c170..e7af43b9a159f76b8813502bc5f400da798312cb 100644 (file)
@@ -193,7 +193,7 @@ int32 GPS_Get_Ack(int32 fd, GPS_PPacket *tra, GPS_PPacket *rec)
     if(LINK_ID[0].Pid_Ack_Byte != (*rec)->type)
     {
        gps_error = FRAMING_ERROR;
-       return 0;
+/* rjl return 0; */
     }
     
     if(*(*rec)->data != (*tra)->type)
index 1e83489ba74bed3f3fb1183ec373ed905a86692c..f486308dfbd9d0886d417a65b0cb08d2a5c46594 100644 (file)
@@ -657,7 +657,6 @@ mag_trkparse(char *trkmsg)
 
        waypt  = xcalloc(sizeof *waypt, 1);
 
-       printf("%s\n", trkmsg);
        memset(&tm, 0, sizeof(tm));
 
        sscanf(trkmsg,"$PMGNTRK,%lf,%c,%lf,%c,%d,%c,%d.%d,A,,%d",